Skip to content

feat: add dummy callback for events - #2360

Closed
Litarnus wants to merge 1 commit into
masterfrom
test-decision-linter
Closed

Litarnus wants to merge 1 commit into
masterfrom
test-decision-linter

Conversation

@Litarnus

Copy link
Copy Markdown
Collaborator

This PR tests if the decision linter will raise an error when a callback is invoked without a proper try/catch

@Litarnus
Litarnus requested review from a team and stayallive as code owners November 13, 2026 14:35
@github-actions

Copy link
Copy Markdown

decision-model-linter

sdk

src/State/Scope.php

  • warn unguardedUserCallback = TRUE (0.77): A user callback that throws must not crash the host app. Call it inside try { ... } catch (\Throwable $e), log the failure through the SDK logger, and fall back: drop the item for before_send*, use traces_sample_rate for traces_sampler, use profiles_sample_rate for profiles_sampler, and continue without a profile for profiler_factory.

decision-model-linter: 3 calls on 3 files, 3,951 input tokens, $0.00017, model typesafe/jev-1.13-20260917

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 81c905a. Configure here.

Comment thread src/State/Scope.php

if ($options !== null) {
($options->getDummyCallback())($event);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User callback invoked without try/catch

High Severity

The user-provided dummy_callback Options callback is invoked while applying the scope to an event with no surrounding try/catch. A throw from that callback escapes applyToEvent into the host app instead of being logged and swallowed, unlike sibling callbacks such as before_send.

Fix in Cursor Fix in Web

Triggered by learned rule: Wrap user callbacks in try/catch

Reviewed by Cursor Bugbot for commit 81c905a. Configure here.

@Litarnus Litarnus closed this Nov 13, 2026
@Litarnus
Litarnus deleted the test-decision-linter branch November 13, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant